package dragon.core.db;

public class ColumnMeta implements Cloneable {

	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	/**
	 * 字段名
	 */
	private String columnName;

	/**
	 * 字段Label
	 */
	private String columnLabel;

	/**
	 * 字段数据类型
	 */
	private int columnType;

	/**
	 * 字段数据类型(文本)
	 */
	private String columnTypeName;

	/**
	 * 字段大小
	 */
	private int columnDisplaySize;

	/**
	 * 字段数据类型对应的Java类名
	 */
	private String columnClassName;

	/**
	 * 是否可空(必填项)columnNoNulls=0;columnNullable=1;columnNullableUnknown=2;
	 */
	private int columnNullable;

	/**
	 * 字段注释
	 */
	private String comment;

	public ColumnMeta(String columnName, String columnLabel, int columnType, String columnTypeName, int columnDisplaySize, String columnClassName, int columnNullable, String comment) {
		this.columnName = columnName;
		this.columnLabel = columnLabel;
		this.columnType = columnType;
		this.columnTypeName = columnTypeName;
		this.columnDisplaySize = columnDisplaySize;
		this.columnClassName = columnClassName;
		this.columnNullable = columnNullable;
		this.comment = comment;
	}

	@Override
	public String toString() {
		return String.format("columnName:%s\tcolumnLabel:%s\tcolumnType:%d\tcolumnTypeName:%s\tcolumnDisplaySize:%d\tcolumnClassName:%s\tcolumnNullable:%d\tcomment:%s", columnName, columnLabel,
				columnType, columnTypeName, columnDisplaySize, columnClassName, columnNullable, comment);
	}

	public String getColumnClassName() {
		return columnClassName;
	}

	public void setColumnClassName(String columnClassName) {
		this.columnClassName = columnClassName;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public int getColumnType() {
		return columnType;
	}

	public void setColumnType(int columnType) {
		this.columnType = columnType;
	}

	public String getColumnTypeName() {
		return columnTypeName;
	}

	public void setColumnTypeName(String columnTypeName) {
		this.columnTypeName = columnTypeName;
	}

	public int getColumnDisplaySize() {
		return columnDisplaySize;
	}

	public void setColumnDisplaySize(int columnDisplaySize) {
		this.columnDisplaySize = columnDisplaySize;
	}

	public String getColumnLabel() {
		return columnLabel;
	}

	public void setColumnLabel(String columnLabel) {
		this.columnLabel = columnLabel;
	}

	public int getColumnNullable() {
		return columnNullable;
	}

	public void setColumnNullable(int columnNullable) {
		this.columnNullable = columnNullable;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
}
